<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>防止在鼠标按下时的选择</title>
	</head>
	<body>
		<h1>我是H1...我是H1...我是H1</h1>

		<script>
			const h1 = document.querySelector('h1')

			h1.addEventListener('mousedown', (event) => {
				event.preventDefault() // 阻止浏览器默认行为(按下鼠标时选中文本)
			})

			h1.addEventListener('dblclick', (event) => {
				alert('双击事件')
			})
		</script>
	</body>
</html>
